#ifndef SAMPLE_H_
#define SAMPLE_H_

#include "stm32f4xx_hal.h"
#include "ad7190.h"
#include "buffer.h"

/**
 *  @error
 *  @{
 */
#define SAMPLE_ERROR_NONE       0U
#define SAMPLE_ERROR_BUFFER_NUL 1U
#define SAMPLE_ERROR_AD7190_NUL 2U
#define SAMPLE_ERROR_TIM_NUL    3U
#define SAMPLE_ERROR_HARDWARE   4U
#define SAMPLE_ERROR_PTR_NUL    5U
/**
 *  @}
 */
 
/**
 *  @struct
 *  @{
 */
typedef struct _Sample sample_t;
struct _Sample { 
    AD7190_HandleTypeDef *Ad7190_Handle;
    buffer_t *In;
    __IO uint32_t ErrorCode;
};
/**
 *  @}
 */

/**
 *  @API
 *  @{
 */
HAL_StatusTypeDef Sample_Start(sample_t*);
HAL_StatusTypeDef Sample_Stop(sample_t*);
uint32_t Sample_Step(sample_t*);
/**
 *  @}
 */

/**
 *  @Callback
 *  @{
 */
void Sample_Complete(sample_t *thiz);
/**
 *  @}
 */

#endif /* SAMPLE_H_ */
